package com.edu.controller;


import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

//@ControllerAdvice
public class ExceptionController {

    @ExceptionHandler(Throwable.class)
    public ModelAndView exceptionHandler(){
        ModelAndView mv = new ModelAndView();
        mv.addObject("msg","出错啦~");
        mv.setViewName("forward:/error.jsp");
        return mv;
    }
}
